import { get, post, put, remove } from "./index";

export function oneById(id) {
  return get("device/" + id);
}

export function page(query) {
  return get("device/page", query);
}

export function list(query) {
  return get("device/list", query);
}

export function one(query) {
  return get("device/one", query);
}

export function excel(query) {
  return post("device/export", query);
}

export function create(data) {
  return post("device", data);
}

export function update(data) {
  return put("device", data);
}

export function changeMode(data) {
  return put("device/mode", data);
}

export function changeName(data) {
  return put("device/name", data);
}

export function command(data) {
  return put(`device/command`, data);
}

export function operate(data) {
  return put(`device/operate`, data);
}

export function deleteById(id) {
  return remove("device/" + id);
}

export default {
  oneById,
  page,
  list,
  one,
  excel,
  create,
  update,
  changeMode,
  changeName,
  command,
  operate,
  deleteById,
};
